package com.sprucetec.live.enums;

/**
 * @author chenwei11
 * @description 视频操作类型枚举
 * @date 2020/1/3 16:47
 * @Version 1.0
 */
public enum LiveOperationTypeEnum {

    /**
     *  创建直播
     */
    CREATE_LIVE(0, "创建直播"),
    UPDATE_LIVE(1, "修改直播"),
    DELETE_LIVE(2, "删除直播"),
    DOWN_SHELVES(3, "下架直播"),
    UP_SHELVES(4, "开启直播"),
    CLOSE_LIVE(5, "关闭直播"),
    TOP_LIVE(6, "置顶直播"),
    CANCEL_TOP(7, "取消置顶"),
    SET_CAROUSEL(8, "设为轮播"),
    CANCEL_CAROUSEL(9, "取消轮播");

    private Integer code;
    private String desc;

    LiveOperationTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String code2Desc(Integer code) {
        for (LiveOperationTypeEnum status : LiveOperationTypeEnum.values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
